<template>
  <div>
    <el-table
    ref="multipleTable"
    :data="tableData"
    tooltip-effect="dark"
    border
    stripe
    style="width: 100%"
    @selection-change="handleSelectionChange">
    <el-table-column
      type="selection"
      width="55">
    </el-table-column>
    <el-table-column
      prop="name"
      label="名称"
      width="120">
    </el-table-column>
    <el-table-column
      prop="code"
      label="唯一编码"
      show-overflow-tooltip>
    </el-table-column>
    <el-table-column
      prop="remark"
      label="描述"
      show-overflow-tooltip>
    </el-table-column>
    <el-table-column prop="statu" label="状态">
      <template slot-scope="scope">
        <el-tag size="small" v-if="scope.row.statu === 1" type="success">正常</el-tag>
        <el-tag size="small" v-else-if="scope.row.statu === 0" type="danger">禁用</el-tag>
      </template>
    </el-table-column>
     <el-table-column prop="operation" label="操作">
        <template slot-scope="scope">
          <el-button type="text">分配权限</el-button>
          <el-divider direction="vertical"></el-divider>
          <el-button type="text">编辑</el-button>
          <el-divider direction="vertical"></el-divider>
          <template>
            <el-popconfirm title="确定删除吗？" @confirm="delHandle(scope.row.id)">
              <el-button type="text" slot="reference">删除</el-button>
            </el-popconfirm>
          </template>
        </template>
      </el-table-column>
  </el-table>
  </div>
</template>
<script>
export default {
  name: 'Role',
  data () {
    return {
      tableData: []
    }
  },
  methods: {
    getRoleList () {
      this.$axios.get('/sys/role/list', {
        params: {
          name: '',
          current: '',
          size: ''
        }
      }).then((result) => {
        this.tableData = result.data.data
      })
    }
  }
}
</script>
<style scoped>

</style>
